package com.bestom.smartwatch.helper;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class SQLiteHelper extends SQLiteOpenHelper {

    private static final String DATABASE_NAME = "SmartWatch.db";
    private static final int DATABASE_VERSION = 1;

    public SQLiteHelper(Context context){
        super(context,DATABASE_NAME,null,DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        // students 学生属性表
        db.execSQL("CREATE TABLE IF NOT EXISTS students(" +
                "_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
                "device_id TEXT, " +
                "students_name TEXT, " +
                "students_id TEXT, " +
                "students_class TEXT" +
                ")");
        // students_data 学生数据表
        db.execSQL("CREATE TABLE IF NOT EXISTS students_data(" +
                "_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
                "device_id TEXT, " +
                "students_name TEXT, " +
                "students_max_temp TEXT, " +
                "students_body_temp TEXT, " +
                "students_skin_temp TEXT, " +
                "students_step TEXT, " +
                "students_calories TEXT," +
                "students_distance TEXT," +
                "students_heart_rate TEXT," +
                "students_systolic_blood_pressure TEXT," +
                "students_diastolic_blood_pressure TEXT," +
                "students_blood_oxygen TEXT," +
                "students_time TEXT" +
                ")");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
